<?php
namespace Addons\QyWechat\Controller\Api\Providers;

use Models\BaseModel as Model;
use Addons\QyWechat\Helper;
 
class Verify extends \BaseController
{
    public function index(){
        $domain=$_SERVER['HTTP_HOST'];
        $agency=new Model('user_agency');
        $agency->find(array('domain'=>$domain));
        $is_scan=$agency->is_scan;
        $thirdappsetting=(new Model('qy_agency_thirdappsetting'))->find(['pid'=>$agency->id]);
        $url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=".$thirdappsetting->suite_id."&redirect_uri=http://work.yundp.top&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect";
       \Redirect::to($url);
    }
}